Ext.define('MyApp.view.LoginView' ,{
	extend: 'Ext.window.Window',
	//extend: 'Ext.panel.Panel',
	closable: false, //关闭按钮不显示
	resizable :false,//窗口大小固定不变
	alias : 'widget.loginview',
	title:'用户登录',
	width : 500,
	height : 300,
	modal : true,
	layout: {
		align: 'middle',
		pack: 'center',
		type: 'hbox'
	},
	initComponent : function() {
		this.items = [
			{
			xtype : 'form',
			border : false,
			margin: '10',
			items :
				[
					{
							xtype: 'panel',
							layout: 'vbox',
							border: false,
							defaults: {
								labelAlign: 'right',
								labelWidth: 100,
								margin: '6'
							},
							items: [
								{
									xtype: 'textfield',
									width: 260,
									name: 'staff_loginname',
									allowBlank: false,
									fieldLabel: '登录账号',
									length: 16
								},
								{
									xtype: 'textfield',
									width: 260,
									name: 'staff_password',
									allowBlank: false,
									fieldLabel: '登录密码',
									length: 100
								}]
					},
					{
						xtype: 'panel',
						layout: 'hbox',
						border: false,
						height:30,
						defaults: {
							labelAlign: 'right',
							labelWidth: 100,
							margin: '6'
						},
						items: [
							{
								xtype: 'textfield',
								width: 180,
								name: 'code_value',
								allowBlank: false,
								fieldLabel: '验证码',
								length: 70
							},
							{
								html : '<img style="height: 24px" id="photo" border="0" width="65px" src="main/code.action" onmousedown="changeImg(this)" />'
							}]
					}
				]
			},
			{
				xtype : 'panel',
				border : false,
				margin: '10',
				items : [
					{
						xtype: 'box', //或者xtype: 'component',
						width: 132,
						id: 'imagebox',
						name: 'imagebox',
						height: 136,
						autoEl: {
							tag: 'img',    //指定为img标签
							src: 'resource/images/login.jpg'    //指定url路径
						}
					}
				]
			}];
		this.fbar = [
			{
				xtype: 'button',
				//margin: '6',
				text: '登录',
				name: 'btn-save',
				iconCls: 'btn-save'
			},{
				xtype: 'button',
				//margin: '6',
				text: '取消',
				name: 'btn-cancel',
				iconCls: 'btn-cancel',
				scope: this,
				handler: this.close
			}];
		this.callParent(arguments);
	}

});

